home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_13_06 / saks / drftxmpl.h < prev   
C/C++ Source or Header  |  1995-04-06  |  506b  |  25 lines

  1. Listing 2 - The example from the C++ draft standard 
  2. illustrating the class scope rules.
  3.  
  4. typedef int  c;
  5. enum { i = 1 };
  6.  
  7. class X
  8.     {
  9.     char v[i];  // error: 'i' refers to ::i
  10.                 // but when reevaluated is X::i
  11.     int  f() { return sizeof(c); }  // okay: X::c
  12.     char  c;
  13.     enum { i = 2 };
  14.     };
  15.  
  16. typedef char*  T;
  17. struct Y
  18.     {
  19.     T a;        // error: 'T' refers to ::T
  20.                 // but when reevaluated is Y::T
  21.     typedef long T;
  22.     T b;
  23.     };
  24.  
  25.